#ifndef _WINUSER_ISS__
#define _WINUSER_ISS__

#include "wtypes.iss"

#ifndef _WIN32_WINNT 
#define _WIN32_WINNT  0x0501
#endif

#ifndef WINVER 
#define WINVER _WIN32_WINNT
#endif

[code]
const
  GWL_WNDPROC       = (-4);
  GWL_HINSTANCE     = (-6);
  GWL_HWNDPARENT    = (-8);
  GWL_STYLE         = (-16);
  GWL_EXSTYLE       = (-20);
  GWL_USERDATA      = (-21);
  GWL_ID            = (-12);


  GCL_MENUNAME      = (-8);
  GCL_HBRBACKGROUND = (-10);
  GCL_HCURSOR       = (-12);
  GCL_HICON         = (-14);
  GCL_HMODULE       = (-16);
  GCL_CBWNDEXTRA    = (-18);
  GCL_CBCLSEXTRA    = (-20);
  GCL_WNDPROC       = (-24);
  GCL_STYLE         = (-26);

  WM_QUIT           = $0012;
  WM_SETCURSOR      = $0020;
  WM_COMMAND        = $0111; 
  WM_CLOSE          = $0010;
  WM_DESTROY        = $0002;

  WS_EX_LAYERED     = $00080000;

  CS_VREDRAW        = 0001;
  CS_HREDRAW        = $0002;
  CS_DBLCLKS        = $0008;
  CS_OWNDC          = $0020;
  CS_CLASSDC        = $0040;
  CS_PARENTDC       = $0080;
  CS_NOCLOSE        = $0200;
  CS_SAVEBITS       = $0800;
  CS_BYTEALIGNCLIENT= $1000;
  CS_BYTEALIGNWINDOW= $2000;
  CS_GLOBALCLASS    = $4000;

  CS_IME            = $00010000;
#if (_WIN32_WINNT >= 0x0501)
  CS_DROPSHADOW     = $00020000;
#endif

  IDC_ARROW         = (32512);
  IDC_IBEAM         = (32513);
  IDC_WAIT          = (32514);
  IDC_CROSS         = (32515);
  IDC_UPARROW       = (32516);
  IDC_SIZE          = (32640);
  IDC_ICON          = (32641);
  IDC_SIZENWSE      = (32642);
  IDC_SIZENESW      = (32643);
  IDC_SIZEWE        = (32644);
  IDC_SIZENS        = (32645);
  IDC_SIZEALL       = (32646);
  IDC_NO            = (32648);

  IDC_HAND          = (32649);
  IDC_APPSTARTING   = (32650);
  IDC_HELP          = (32651);
  
  MF_INSERT         = $00000000;
  MF_CHANGE         = $00000080;
  MF_APPEND         = $00000100;
  MF_DELETE         = $00000200;
  MF_REMOVE         = $00001000;

  MF_BYCOMMAND      = $00000000;
  MF_BYPOSITION     = $00000400;

  MF_SEPARATOR      = $00000800;

  MF_ENABLED        = $00000000;
  MF_GRAYED         = $00000001;
  MF_DISABLED       = $00000002;

  MF_UNCHECKED      = $00000000;
  MF_CHECKED        = $00000008;
  MF_USECHECKBITMAPS= $00000200;

  MF_STRING         = $00000000;
  MF_BITMAP         = $00000004;
  MF_OWNERDRAW      = $00000100;

  MF_POPUP          = $00000010;
  MF_MENUBARBREAK   = $00000020;
  MF_MENUBREAK      = $00000040;

  MF_UNHILITE       = $00000000;
  MF_HILITE         = $00000080;

#if (WINVER >= 0x0400)
  MF_DEFAULT        = $00001000;
#endif
  MF_SYSMENU        = $00002000;
  MF_HELP           = $00004000;
#if (WINVER >= 0x0400)
  MF_RIGHTJUSTIFY   = $00004000;
#endif 

  MF_MOUSESELECT    = $00008000;
#if (WINVER >= 0x0400)
  MF_END            = $00000080;
#endif

  SC_SIZE           = $F000;
  SC_MOVE           = $F010;
  SC_MINIMIZE       = $F020;
  SC_MAXIMIZE       = $F030;
  SC_NEXTWINDOW     = $F040;
  SC_PREVWINDOW     = $F050;
  SC_CLOSE          = $F060;
  SC_VSCROLL        = $F070;
  SC_HSCROLL        = $F080;
  SC_MOUSEMENU      = $F090;
  SC_KEYMENU        = $F100;
  SC_ARRANGE        = $F110;
  SC_RESTORE        = $F120;
  SC_TASKLIST       = $F130;
  SC_SCREENSAVE     = $F140;
  SC_HOTKEY         = $F150;
#if (WINVER >= 0x0400)
  SC_DEFAULT        = $F160;
  SC_MONITORPOWER   = $F170;
  SC_CONTEXTHELP    = $F180;
  SC_SEPARATOR      = $F00F;
#endif
    
  QS_KEY            = $0001;
  QS_MOUSEMOVE      = $0002;
  QS_MOUSEBUTTON    = $0004;
  QS_POSTMESSAGE    = $0008;
  QS_TIMER          = $0010;
  QS_PAINT          = $0020;
  QS_SENDMESSAGE    = $0040;
  QS_HOTKEY         = $0080;
  QS_ALLPOSTMESSAGE = $0100;
  
  QS_RAWINPUT       = $0400;
  QS_TOUCH          = $0800;
  QS_POINTER        = $0100;
          QS_MOUSE          = QS_MOUSEMOVE or QS_MOUSEBUTTON;

#if (_WIN32_WINNT >= 0x602)
  QS_INPUT          = QS_MOUSE or QS_KEY or QS_RAWINPUT or QS_TOUCH or QS_POINTER;
#else
#if (_WIN32_WINNT >= 0x0501)
  QS_INPUT          = QS_MOUSE or QS_KEY or QS_RAWINPUT;
#else
  QS_INPUT          = QS_MOUSE or QS_KEY;
#endif // (_WIN32_WINNT >= 0x0501)
#endif

  QS_ALLEVENTS      = QS_INPUT or QS_POSTMESSAGE or QS_TIMER or QS_PAINT or QS_HOTKEY;                  
  QS_ALLINPUT       = QS_INPUT or QS_POSTMESSAGE or QS_TIMER or QS_PAINT or QS_HOTKEY or QS_SENDMESSAGE;

  PM_NOREMOVE       = $0000;
  PM_REMOVE         = $0001;
  PM_NOYIELD        = $0002;

  PM_QS_INPUT       = QS_INPUT shl 16;
  PM_QS_PAINT       = QS_PAINT shl 16;
  PM_QS_POSTMESSAGE = (QS_POSTMESSAGE or QS_HOTKEY or QS_TIMER) shl 16;
  PM_QS_SENDMESSAGE = QS_SENDMESSAGE shl 16;

  LWA_COLORKEY      = $00000001;
  LWA_ALPHA         = $00000002;

//user32.dll
function PeekMessage(var lpMsg: MSG; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
function TranslateMessage(const lpMsg: MSG): BOOL; external 'TranslateMessage@user32.dll stdcall';
function DispatchMessage(const lpMsg: MSG): LRESULT; external 'DispatchMessageA@user32.dll stdcall';function GetParent(hWnd: HWND): HWND; external 'GetParent@user32.dll stdcall';
function GetDC(hWnd: HWND): HDC; external 'GetDC@user32.dll stdcall';
function LoadCursorFromFile(lpFileName: PAnsiChar): HCURSOR; external 'LoadCursorFromFileA@user32 stdcall';
function LoadCursor(hInstance: HINSTANCE; lpCursorName: PAnsiChar): HCURSOR; external 'LoadCursorA@user32.dll stdcall';

function GetActiveWindow(): HWND; external 'GetActiveWindow@user32.dll stdcall';
function EnableWindow(hWnd: HWND; bEnable: BOOL): BOOL; external 'EnableWindow@user32.dll stdcall';

function GetWindowLong(hWnd: HWND; nIndex: Integer): LONG; external 'GetWindowLongA@user32.dll stdcall';
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: LONG): LONG; external 'SetWindowLongA@user32.dll stdcall';

function GetClassLong(hWnd: HWND; nIndex: Integer): DWORD; external 'GetClassLongA@user32.dll stdcall';
function SetClassLong(hWnd: HWND; nIndex: Integer; dwNewLong: LONG): DWORD; external 'SetClassLongA@user32.dll stdcall';

function GetSystemMenu(hWnd: HWND; bRevert: BOOL): HMENU; external 'GetSystemMenu@user32.dll stdcall';
function RemoveMenu(hMenu: HWND; uPosition: UINT; uFlags: UINT): BOOL; external 'RemoveMenu@user32.dll stdcall';

function SetWindowText(hWnd: HWND; lpString: PAnsiChar): BOOL; external 'SetWindowTextA@user32.dll';
function SetWindowRgn(hWnd: HWND; hRgn: HRGN; bRedraw: BOOL): Integer; external 'SetWindowRgn@user32.dll stdcall';

function ShowWindow(hWnd: HWND; nCmdShow: Integer): BOOL; external 'ShowWindow@user32.dll stdcall';

function SetTimer(hWnd: HWND; nIDEvent: UINT_PTR; uElapse: UINT; lpTimerFunc: TIMERPROC): UINT_PTR; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd: HWND; uIDEvent: UINT_PTR): BOOL; external 'KillTimer@user32.dll stdcall';

function SetLayeredWindowAttributes(hwnd: HWND; crKey: COLORREF; bAlpha: BYTE; dwFlags: DWORD): BOOL; external 'SetLayeredWindowAttributes@user32 stdcall';

//kernel32.dl
function GetLastError(): DWORD; external 'GetLastError@kernel32.dll stdcall';
function GetTickCount(): DWORD; external 'GetTickCount@kernel32.dll stdcall';

//shell32.dll
procedure SHChangeNotify(wEventId: LONG; uFlags: UINT; dwItem1:LPCVOID; dwItem2:LPCVOID); external 'SHChangeNotify@shell32.dll stdcall';

#endif
